# 实现判断一个数是不是回文数的函数


def is_palindrome(num):
    """
    判断一个数是否为回文数
    :param num
    """
    temp = num
    total = 0
    while temp > 0:
        total = total * 10 + temp % 10
        temp //= 10
    return total == num


if __name__ == "__main__":
    print(is_palindrome(12321))